/*
 * @Author       : 邱狮杰
 * @Date         : 2021-05-08 15:12:19
 * @LastEditTime : 2021-05-08 15:52:07
 * @FilePath     : /abc/js/queryResultBar.js
 * @Description  : queryResultBar
 */
$(function () {
  const showList = ['examResultPage', 'listeningPart', 'readingPart', 'writingPart']
  $('.bar').click(function (e) {
    $('.bar span').removeClass('actionSpan')
    if (e.target.tagName === 'SPAN') {
      $(this)
        .children('.block')
        .css('left', `${parseInt($(e.target).addClass('actionSpan').attr('data-index'))}%`)
      showList.filter(showItemClassName => showItemClassName !== $(e.target).attr('data-show')).forEach(className => $(`.${className}`).css('display', 'none'))
      $(`.${$(e.target).attr('data-show')}`).css('display', 'block')
    }
  })
})
